﻿function newForm(paramx, paramy, paramwidth, paramheight, paramtitle, parambgcolor, paraformname) {
    var fName = "frm" + rand(1000000)
    if (arguments.length == 0) { var x = 0, y = 0, mwidth = 500, mheight = 500, mtitle = "NewForm", bgcolor = "#ffffff"; }
    if (arguments.length == 1) { var x = paramx, y = 0, mwidth = 500, mheight = 500, mtitle = "NewForm", bgcolor = "#ffffff"; }
    if (arguments.length == 2) { var x = paramx, y = paramy, mwidth = 500, mheight = 500, mtitle = "NewForm", bgcolor = "#ffffff"; }
    if (arguments.length == 3) { var x = paramx, y = paramy, mwidth = paramwidth, mheight = 500, mtitle = "NewForm", bgcolor = "#ffffff"; }
    if (arguments.length == 4) { var x = paramx, y = paramy, mwidth = paramwidth, mheight = paramheight, mtitle = "NewForm", bgcolor = "#ffffff"; }
    if (arguments.length == 5) { var x = paramx, y = paramy, mwidth = paramwidth, mheight = paramheight, mtitle = paramtitle, bgcolor = "#ffffff"; }
    if (arguments.length == 6) { var x = paramx, y = paramy, mwidth = paramwidth, mheight = paramheight, mtitle = paramtitle, bgcolor = parambgcolor; }
    if (arguments.length == 7) { var x = paramx, y = paramy, mwidth = paramwidth, mheight = paramheight, mtitle = paramtitle, bgcolor = parambgcolor, fName = paraformname; }

    var w3c = (document.getElementById) ? true : false;
    var ie = (document.all) ? true : false;
    var opacity = 85, toolbarheight = 0, ttlheight = 25;
    if (document.all(fName)) { document.all(fName).style.display = "block"; return; }
    var t = "<div id='" + fName + "' style='display:none;position:absolute;z-index:3;width:" + mwidth + "px;height:" + mheight + "px;left:" + x + ";top:" + y + ";'>";
    t = t + "<p align='left'><div id='form_" + fName + "' style='filter:shadow(color=#000000,direction=135);z-index:4;border:0px;width:" + mwidth + "px;height:" + mheight + "px;left:0;top:0;'>";
    t = t + "<p align='left' valign='top'><table border='0' cellspacing='0' cellpadding='0' style='top:0;left:0;width:" + (mwidth - 10) + "px;height:" + (mheight - 5) + "px;' cellspacing='0' cellpadding='0'>";
    t = t + "<tr><td id='opacity_" + fName + "' colspan='3' height='5' style='filter:alpha(opacity=" + opacity + ");'>";
    t = t + "<div>";
    //描绘三个按扭
    //按扭的外框
    t = t + "<div style='display:block;position:absolute;z-index:10;left:" + (mwidth - 112) + ";top:6;width:95px;height:18px;'>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#cccccc;overflow:hidden;left=0px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#cccccc;overflow:hidden;left=94px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#cccccc;overflow:hidden;left=3px;top=17px;width=89px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#cccccc;overflow:hidden;left=1px;top=15px;width=1px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#cccccc;overflow:hidden;left=2px;top=16px;width=1px;height:1px\"></div>";

    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#cccccc;overflow:hidden;left=93px;top=15px;width=1px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#cccccc;overflow:hidden;left=92px;top=16px;width=1px;height:1px\"></div>";

    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#666666;overflow:hidden;left=1px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#666666;overflow:hidden;left=93px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;background:#666666;overflow:hidden;left=3px;top=16px;width=89px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#666666;overflow:hidden;left=2px;top=15px;width=1px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:12;background:#666666;overflow:hidden;left=92px;top=15px;width=1px;height:1px\"></div>";
    //最小化按扭
    t = t + "  <div style=\"display:block;position:absolute;z-index:11;overflow:hidden;left=2px;top=0px;width=91px;height:16px\">";
    t = t + "	<div id='" + fName + "_bt_min_mask' style=\"filter:alpha(opacity=1);display:block;position:absolute;z-index:25;background:red;overflow:hidden;left=0px;top=0px;width=25px;height:16px;cousor:hand;\" onmouseover=\"document.all('" + fName + "_bt_min').style.backgroundColor='red';document.all('" + fName + "_bt_min').style.filter='alpha(opacity=70)';\" onmouseout=\"document.all('" + fName + "_bt_min').style.backgroundColor='';document.all('" + fName + "_bt_min').style.filter='alpha(opacity=" + (120 - opacity) + ")';\"></div>";
    t = t + "	<div id='" + fName + "_bt_min' style=\"filter:alpha(opacity=" + (120 - opacity) + ");display:block;position:absolute;z-index:21;background:;overflow:hidden;left=0px;top=0px;width=25px;height:16px;cousor:hand;\">";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=100,FinishOpacity=40,startX=1,finishX=1,startY=1,finishY=30,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=40,FinishOpacity=0,startX=1,finishX=1,startY=30,finishY=35,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=0,FinishOpacity=80,startX=1,finishX=1,startY=75,finishY=100,Style=1);'></div>";
    t = t + "	</div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=6px;top=8px;width=12px;height:5px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=7px;top=9px;width=10px;height:3px\"></div>";
    //最大化按扭
    t = t + "	<div id='" + fName + "_bt_max_mask' style=\"filter:alpha(opacity=1);display:block;position:absolute;z-index:25;background:red;overflow:hidden;left=25px;top=0px;width=25px;height:16px\" onmouseover=\"document.all('" + fName + "_bt_max').style.backgroundColor='red';document.all('" + fName + "_bt_max').style.filter='alpha(opacity=70)';\" onmouseout=\"document.all('" + fName + "_bt_max').style.backgroundColor='';document.all('" + fName + "_bt_max').style.filter='alpha(opacity=" + (120 - opacity) + ")';\"></div>";
    t = t + "	<div id='" + fName + "_bt_max' style=\"filter:alpha(opacity=" + (120 - opacity) + ");display:block;position:absolute;z-index:21;background:;overflow:hidden;left=25px;top=0px;width=25px;height:16px\">";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=100,FinishOpacity=40,startX=1,finishX=1,startY=1,finishY=30,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=40,FinishOpacity=0,startX=1,finishX=1,startY=30,finishY=35,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:25px;height:16px;background:#ffffff;filter:Alpha(Opacity=0,FinishOpacity=80,startX=1,finishX=1,startY=75,finishY=100,Style=1);'></div>";
    t = t + "	</div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=32px;top=4px;width=10px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=32px;top=10px;width=10px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=32px;top=4px;width=2px;height:8px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=40px;top=4px;width=2px;height:8px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#F2F2F2;overflow:hidden;left=40px;top=4px;width=2px;height:8px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;overflow:hidden;left=31px;top=3px;width=12px;height:10px;border-style:solid;border-width:1px;border-color:#666666;\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;overflow:hidden;left=34px;top=6px;width=6px;height:4px;border-style:solid;border-width:1px;border-color:#666666;\"></div>";
    //关闭按扭
    t = t + "	<div id='" + fName + "_bt_cls_mask' style=\"filter:alpha(opacity=1);display:block;position:absolute;z-index:25;background:red;overflow:hidden;left=50px;top=0px;width=41px;height:16px\" onmouseover=\"document.all('" + fName + "_bt_cls').style.backgroundColor='red';document.all('" + fName + "_bt_cls').style.filter='alpha(opacity=70)';\" onmouseout=\"document.all('" + fName + "_bt_cls').style.backgroundColor='';document.all('" + fName + "_bt_cls').style.filter='alpha(opacity=" + (120 - opacity) + ")';\" onclick=\"document.all('" + fName + "').closeButton();\"></div>";
    t = t + "	<div id='" + fName + "_bt_cls' style=\"filter:alpha(opacity=" + (120 - opacity) + ");display:block;position:absolute;z-index:21;background:;overflow:hidden;left=50px;top=0px;width=41px;height:16px\">";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:41px;height:16px;background:#ffffff;filter:Alpha(Opacity=100,FinishOpacity=40,startX=1,finishX=1,startY=1,finishY=30,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:41px;height:16px;background:#ffffff;filter:Alpha(Opacity=40,FinishOpacity=0,startX=1,finishX=1,startY=30,finishY=35,Style=1);'></div>";
    t = t + "	  <div style='display:block;position:absolute;z-index:21;left:0;top:0;width:41px;height:16px;background:#ffffff;filter:Alpha(Opacity=0,FinishOpacity=80,startX=1,finishX=1,startY=75,finishY=100,Style=1);'></div>";
    t = t + "	</div>";
    //按扭的圆角
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=66px;top=3px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=65px;top=4px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=66px;top=5px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=67px;top=6px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=68px;top=7px;width=5px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=69px;top=9px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=70px;top=10px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=71px;top=11px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=72px;top=12px;width=3px;height:1px\"></div>";

    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=66px;top=4px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=67px;top=5px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=68px;top=6px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=69px;top=7px;width=3px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=70px;top=9px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=71px;top=10px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=72px;top=11px;width=3px;height:1px\"></div>";

    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=66px;top=12px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=65px;top=11px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=66px;top=10px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=67px;top=9px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=68px;top=7px;width=5px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=69px;top=6px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=70px;top=5px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=71px;top=4px;width=5px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:23;background:#666666;overflow:hidden;left=72px;top=3px;width=3px;height:1px\"></div>";

    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=66px;top=11px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=67px;top=10px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=68px;top=9px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=69px;top=7px;width=3px;height:2px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=70px;top=6px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=71px;top=5px;width=3px;height:1px\"></div>";
    t = t + "	  <div style=\"display:block;position:absolute;z-index:24;background:#F2F2F2;overflow:hidden;left=72px;top=4px;width=3px;height:1px\"></div>";

    t = t + "  </div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:22;background:#666666;overflow:hidden;left=26px;top=0px;width=1px;height:17px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:22;background:#666666;overflow:hidden;left=51px;top=0px;width=1px;height:17px\"></div>";

    t = t + "<div style='filter:alpha(opacity=50);display:block;position:absolute;z-index:20;left:0;top:0;width:95px;height:18px;'>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=2px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=25px;top=0px;width=1px;height:16px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=3px;top=15px;width=23px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=27px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=50px;top=0px;width=1px;height:16px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=27px;top=15px;width=25px;height:1px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=52px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=92px;top=0px;width=1px;height:15px\"></div>";
    t = t + "  <div style=\"display:block;position:absolute;z-index:21;background:#ffffff;overflow:hidden;left=52px;top=15px;width=40px;height:1px\"></div>";
    t = t + "</div>";
    t = t + "</div>";

    //窗体边框
    t = t + "<b style='display:block;overflow:hidden;margin:0px 0px 0px 0px;height: 7px;'>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 6px 0px 6px;height: 1px;'></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 4px 0px 4px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 3px 0px 3px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 1px 0px 1px;height: 2px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 2px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 0px 0px 0px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "</b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 0px 0px 0px;height: " + (mheight - 29) + "px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: " + (mheight - 29) + ";'></b></b>";
    t = t + "<b style='display:block;overflow:hidden;margin:0px 0px 0px 0px;height: 7px;'>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 0px 0px 0px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 1px 0px 1px;height: 2px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 2px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 3px 0px 3px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 4px 0px 4px;height: 1px;'><b style='display:block;background:" + bgcolor + ";overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'></b></b>";
    t = t + "<b style='display:block;background:#ffffff;overflow:hidden;margin:0px 6px 0px 6px;height: 1px;'></b>";
    t = t + "</b>";
    t = t + "</td></tr></table>";
    t = t + "</div>";

    //标题栏
    t = t + "<div style='display:block;position:absolute;z-index:9;left:7;top:6;width:" + (mwidth - 24) + "px;height:" + ttlheight + "px;' onmousedown=oMouseDown(this,document.all('" + fName + "')) onmousemove=oMouseMove() onmouseup=oMouseUp()>";
    // onmousedown=oMouseDown(this,document.all('"+fName+"')) onmousemove=oMouseMove() onmouseup=oMouseUp()
    t = t + "<p align='left'>";
    t = t + "<table border='0' style='table-layout:fixed;height:" + ttlheight + ";' width='100%' cellspacing='0' cellpadding='0'>";
    t = t + "<tr>";
    t = t + "<td style='width:24px;'>";
    t = t + "<img id='ico_" + fName + "' src='' style='height:16px;width:16px'></img></td>";
    t = t + "<td id='title_" + fName + "' style='font-size:14px;FILTER: blur(direction=135,strength=3); dropshadow(color=#ffffff,offx=-1,offy=-1,positive=1);text-align:left;'>";
    t = t + mtitle + "</td></tr></table></p>";
    t = t + "</div>";
    //工具栏
    t = t + "<div id='toolbar_container_" + fName + "' style='display:block;position:absolute;background-color:;z-index:4;left:7;top:" + (ttlheight + 6) + ";width:" + (mwidth - 24) + "px;height:" + toolbarheight + "px;'>";
    t = t + "  <div id='toolbar_" + fName + "' style='display:block;background-color:;position:absolute;z-index:5;overflow:auto;left:2;top:2;width:" + (mwidth - 28) + "px;height:" + toolbarheight + "px;'></div>"
    t = t + "</div>";
    //内容栏
    t = t + "<div id='text_container_" + fName + "' style='display:block;position:absolute;z-index:4;left:7;top:" + (ttlheight + toolbarheight + 6) + ";width:" + (mwidth - 24) + "px;height:" + (mheight - ttlheight - toolbarheight - 24) + "px;'>";
    t = t + "  <div id='text_" + fName + "' style='display:block;background-color:#ffffff;position:absolute;z-index:5;overflow:auto;left:2;top:2;width:" + (mwidth - 28) + "px;height:" + (mheight - ttlheight - toolbarheight - 28) + "px;'></div>"
    t = t + "  <b id='text_border1_" + fName + "' style='display:block;background:#E6E6E6;overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b>";
    t = t + "  <b id='text_border2_" + fName + "' style='display:block;background:#E6E6E6;overflow:hidden;margin:0px 0px 0px 0px;height: " + (mheight - ttlheight - toolbarheight - 26) + "px;'>";
    t = t + "  <b id='text_border3_" + fName + "' style='display:block;background:#333333;overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'></b>";
    t = t + "  <b id='text_border4_" + fName + "' style='display:block;background:#333333;overflow:hidden;margin:0px 1px 0px 1px;height: " + (mheight - ttlheight - toolbarheight - 28) + "px;'>";
    t = t + "  </b>"
    t = t + "  <b id='text_border5_" + fName + "' style='display:block;background:#333333;overflow:hidden;margin:0px 2px 0px 2px;height: 1px;'></b>";
    t = t + "  </b>"
    t = t + "  <b id='text_border6_" + fName + "' style='display:block;background:#E6E6E6;overflow:hidden;margin:0px 1px 0px 1px;height: 1px;'></b>";
    t = t + "</div>";
    //内容栏结束

    t = t + "</div>";
    if (document.readyState == "complete" || window.document.readyState == "") { document.body.insertAdjacentHTML("beforeEnd", t); } else { document.write(t); }
    var mtext, mtitle, mico, mopacity, nx, ny, mcolor, mobj;
    var thisForm = (ie) ? document.all[fName] : document.getElementById(fName);

    thisForm.show = function () { thisForm.style.display = "block"; }
    thisForm.hide = function () { thisForm.style.display = "none"; }
    thisForm.setLocation = function (nx, ny) { thisForm.style.left = nx; thisForm.style.top = ny; }
    thisForm.setCenter = function () { thisForm.style.left = (document.body.scrollWidth - mwidth + 20) / 2; x = (document.body.scrollWidth - mwidth + 20) / 2 }
    thisForm.setRightCenter = function () { if (mwidth > document.body.scrollWidth / 2) { thisForm.style.left = (document.body.scrollWidth - mwidth); x = (document.body.scrollWidth - mwidth); } else { thisForm.style.left = (document.body.scrollWidth) / 2; x = (document.body.scrollWidth) / 2; } }
    thisForm.setScrollON = function () { document.body.onscroll = function () { thisForm.setLocation(document.body.scrollLeft + x, document.body.scrollTop + y); } }
    thisForm.setScrollOFF = function () { document.body.onscroll = null; }
    thisForm.setbgColor = function () { }
    thisForm.release = function () { thisForm.removeNode(true); }
    thisForm.closeButton = function () { thisForm.removeNode(true); }

    var thisTitle = (ie) ? document.all['title_' + fName] : document.getElementById('title_' + fName);
    thisForm.setTitle = function (mtitle) { thisTitle.innerHTML = mtitle; }
    var thisText = (ie) ? document.all['text_' + fName] : document.getElementById('text_' + fName);
    thisForm.setScrollBarON = function () { thisText.style.overflow = "auto"; };
    thisForm.setScrollBarOFF = function () { thisText.style.overflow = "hidden"; };
    thisForm.setText = function (mtext) { thisText.innerHTML = mtext; }
    thisForm.loadTextFrom = function (mobj) { if (mobj) { thisText.innerHTML = mobj.innerHTML; mobj.removeNode(true); } }
    var thisIco = (ie) ? document.all['ico_' + fName] : document.getElementById('ico_' + fName);
    thisForm.setIco = function (mico) { thisIco.src = mico; }
    var thisOpacity = (ie) ? document.all['opacity_' + fName] : document.getElementById('opacity_' + fName);
    thisForm.setOpacity = function (mopacity) { thisOpacity.style.filter = "alpha(opacity=" + mopacity + ")"; }

    var thisTextBorder1 = (ie) ? document.all['text_border1_' + fName] : document.getElementById('text_border1_' + fName);
    var thisTextBorder2 = (ie) ? document.all['text_border2_' + fName] : document.getElementById('text_border2_' + fName);
    var thisTextBorder3 = (ie) ? document.all['text_border3_' + fName] : document.getElementById('text_border3_' + fName);
    var thisTextBorder4 = (ie) ? document.all['text_border4_' + fName] : document.getElementById('text_border4_' + fName);
    var thisTextBorder5 = (ie) ? document.all['text_border5_' + fName] : document.getElementById('text_border5_' + fName);
    var thisTextBorder6 = (ie) ? document.all['text_border6_' + fName] : document.getElementById('text_border6_' + fName);
    thisForm.setTextbgColor = function (mcolor) {
        if (mcolor == "") {
            thisText.style.backgroundColor = "";
            thisTextBorder1.style.display = "none";
            thisTextBorder2.style.display = "none";
            thisTextBorder3.style.display = "none";
            thisTextBorder4.style.display = "none";
            thisTextBorder5.style.display = "none";
            thisTextBorder6.style.display = "none";
        }
        else {
            thisText.style.backgroundColor = mcolor;
            thisTextBorder1.style.display = "block";
            thisTextBorder2.style.display = "block";
            thisTextBorder3.style.display = "block";
            thisTextBorder4.style.display = "block";
            thisTextBorder5.style.display = "block";
            thisTextBorder6.style.display = "block";
        }
    }
    return (document.all(fName));
}

//define form finished!

var oObj
function oMouseDown(ome, obj) {
    oSelf = ome
    oObj = obj
    oSelf.setCapture()
    oObj.l = event.x - oObj.style.pixelLeft
    oObj.t = event.y - oObj.style.pixelTop
}

function oMouseMove() {
    if (oObj != null) {
        oObj.style.left = event.x - oObj.l
        oObj.style.top = event.y - oObj.t
    }
}
function oMouseUp() {
    if (oObj != null) {
        oSelf.releaseCapture()
        oObj = null
    }
}

function rnd() {
    rnd.today = new Date();
    rnd.seed = rnd.today.getTime();
    rnd.seed = (rnd.seed * 9301 + 49297) % 233280;
    return rnd.seed / (233280.0);
};

function rand(number) {
    return Math.ceil(rnd() * number);
};   